package ar.edu.caece.dns;

import junit.framework.TestCase;

public class ResolverAppTestCase extends TestCase {

	public ResolverAppTestCase(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testMain() {
		StartApp startApp = new StartApp(new String[] {
				"src/test/resources/clientDNSImplTestCase", "true" });

		startApp.execute();

		String[] consultas = new String[] { "caece.edu.ar", "www.caece.edu.ar",
				"www.google.com.ar", "alumnos.caece.edu.ar",
				"notas.alumnos.caece.edu.ar" };

		for (int i = 0; i < consultas.length; i++) {

			try {
				// Indicamos modo interactivo = false
				ResolverApp.main(new String[] { consultas[i], "false" });

			} catch (Throwable t) {
				t.printStackTrace();
				fail("ResolverApp falla con consulta: " + consultas[i]);
			}
		}

		startApp.terminar();

	}

}
